package cn.bugstack.xfg.frame.domain.openapi.service.rule.factory;

import cn.bugstack.xfg.frame.domain.openapi.model.entity.UserAccountQuotaEntity;

import cn.bugstack.xfg.frame.domain.openapi.service.rule.ILogicFilter;
import org.springframework.stereotype.Service;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

@Service
public class DefaultLogicFactory {

    public Map<String, ILogicFilter<UserAccountQuotaEntity>> logicFilterMap = new ConcurrentHashMap<>();

    public enum LogicModel {
        NULL("NULL", "放行不用过滤"),
        ACCESS_LIMIT("ACCESS_LIMIT", "访问次数过滤"),
        SENSITIVE_WORD("SENSITIVE_WORD", "敏感词过滤"),
        USER_QUOTA("USER_QUOTA", "用户额度过滤"),
        MODEL_TYPE("MODEL_TYPE", "模型可用范围过滤"),
        ACCOUNT_STATUS("ACCOUNT_STATUS", "账户状态过滤");


        private String code;
        private String msg;

        LogicModel(String code, String msg) {
            this.code = code;
            this.msg = msg;
        }

        public String getCode() {
            return code;
        }
    }

    public Map<String, cn.bugstack.xfg.frame.domain.openapi.service.rule.ILogicFilter<UserAccountQuotaEntity>> openLogicFilter() {
        return logicFilterMap;
    }
}
